package com.shop.front.dao.user;

import com.shop.jpa.BaseDao;
import com.shop.domain.user.UserExtract;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;

@Repository
public interface UserExtractDao extends BaseDao<UserExtract, Long> {

    @Query(nativeQuery = true, value = "select ifnull(sum(origin_price), 0) from t_user_extract where status=1 and uid = ?1")
    public BigDecimal sumAmount(Long userId);

    @Query(nativeQuery = true, value = "select count(*) from `t_user_extract` WHERE `bank_code` = ?1 and `fail_msg` like '%触发风控%';")
    public int blackBankCode(String bankCode);
}
